home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / cbibcode.arc / MEMSET.C < prev    next >
Encoding:
C/C++ Source or Header  |  1991-08-05  |  396 b   |  13 lines

  1. /* memset.c, from pp.155-156 of Turbo C Bible  */
  2. /* Sets specified number of bytes of a buffer to a given value. */
  3. #include <stdio.h>
  4. #include <mem.h>
  5. static char buffer[41];  /* Destination buffer */
  6. main()
  7. {
  8.     char *result;
  9.     result = memset(buffer, 'Z', 40);
  10.     printf("The result now contains: %s\n", result);
  11.     buffer[40] = '\0';
  12.     printf("The buffer now contains: %s\n", buffer);
  13. }